@extends('layouts.app', ['activePage' => 'bid', 'titlePage' => __('拍卖品管理')])

@section('content')
  <div class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <div class="card">
            <div class="card-header card-header-primary">
              <h4 class="card-title ">{{ __('拍卖品列表') }}</h4>
            </div>
            <div class="card-body">
              @if (session('status'))
                <div class="row">
                  <div class="col-sm-12">
                    <div class="alert alert-success">
                      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <i class="material-icons">close</i>
                      </button>
                      <span>{{ session('status') }}</span>
                    </div>
                  </div>
                </div>
              @endif
              <div class="table-responsive">
                <table class="table">
                  <thead class="text-primary text-center">
                  <th>编号</th>
                  <th></th>
                  <th class="text-left">拍卖品</th>
                  <th>分类</th>
                  <th>价格</th>
                  <th>时间</th>
                  <th>
                    <span>竞价列表
                        @if ($order=='desc')
                        <a href="bid?order=asc">↓</a>
                        @else
                        <a href="bid">↑</a>
                        @endif
                    </span>
                  </th>
                  <th>状态</th>
                  <th>操作</th>
                  </thead>
                  <tbody>
                  @foreach($bid as $bid)
                    <tr class="text-center">
                      <td>
                        {{ $loop->iteration }}
                      </td>
                      <td>
                        <img src="{{$bid->image_src}}"style="width: 100px;cursor: pointer">
                      </td>
                      <td class="text-left">
                        {{ $bid->title }}
                      </td>
                      <td>
                        {{ $bid->cate->name }}
                      </td>
                      <td>
                        起始价：{{$bid->init_price}} <br>
                        加价幅度：{{$bid->min_gap}} <br>
                        当前价：{{$bid->max_price?$bid->max_price:'暂无'}}
                      </td>
                      <td>
                        起拍时间：{{ $bid->start_time }} <br>
                        结束时间：{{ $bid->end_time }} <br>
                      </td>
                      <td>
                      <a href="#" disabled="true">查看({{ $bid->bid_count}})</a>
                      </td>
                      <td>
                        @switch($bid->status)
                        @case('0') <span class="badge badge-pill badge-warning">未开始</span> @break
                        @case('1') <span class="badge badge-pill badge-danger">进行中</span> @break
                        @case('2') <span class="badge badge-pill badge-success">已成交</span> @break
                        @case('3') <span class="badge badge-pill badge-default">流拍</span> @break
                        @endswitch
                      </td>
                      <td class="td-actions">
                        <button type="button" class="btn btn-danger" data-toggle="tooltip"  data-placement="top" title="移除该商品">
                          <i class="material-icons">close</i>
                        </button>
                      </td>
                    </tr>
                  @endforeach
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
@endsection
